using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DataLayer.Model
{
    [Table("User")]
    public abstract class User
    {
        [Key]
        public int Id { get; set; }
        
        [Required]
        [MaxLength(50)]
        public string Name { get; set; }

        [Required]
        [MaxLength(100)]
        public string Surname { get; set; }

        [Column("Gender")]
        public bool IsFemale { get; set; }

        [InverseProperty("IdReceiver")]
        public virtual ICollection<Message> InboxMessages { get; set; }

        [InverseProperty("IdSender")]
        public virtual ICollection<Message> ComposeMessages { get; set; }

        public User()
        {
            this.InboxMessages = new List<Message>();
            this.ComposeMessages = new List<Message>();
        }
    }
}
